<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
	
	<xsl:template match="/">
		<html>
			<head>
				<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
				<title/>
				<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css"/>
				<link rel="stylesheet" type="text/css" href="../themes/icon.css"/>
				<link rel="stylesheet" type="text/css" href="../styles/common.css"/>
				<script type="text/javascript" src="../scripts/jquery-1.4.2.min.js"/>
				<script type="text/javascript" src="../scripts/jquery.easyui.min.js"/>
				<script type="text/javascript" src="../scripts/easyui-lang-zh_CN.js"/>
				<script type="text/javascript" src="../scripts/common.js"/>
				<script type="text/javascript" src="../scripts/unity.js"/>
				<script type="text/javascript" src="../scripts/ProcessData.js"/>
				<script type="text/javascript">
				  //<![CDATA[
				  //加载国家列表
				  function loadCountryList() {
			
					  $('#AID').combobox({
						  url: './VisaAreaProcess.ashx?State=Query&t=' + new Date().getTime(),
						  valueField: 'AID',
						  textField: 'Country'
					  });
				  }
			
				  $(document).ready(function () {
			
					  //添加数据定义
					  ProcessData.AppendData = function () 
					  {
						  return {
							  AID: $("#AID").combobox('getValue'),
							  Number: $("#Number").val(),
							  Type: $("#Type").val(),
							  Price: $("#Price").val(),
							  Workday: $("#Workday").val(),
							  MaxStay: $("#MaxStay").val(),
							  StayUnit: $("#StayUnit").combobox('getValue'),
							  ValidityDate: $("#ValidityDate").val(),
							  ValidityUnit: $("#ValidityUnit").combobox('getValue'),
							  VisitorArea: $("#VisitorArea").val(),
							  VisaInfo: escape($("#VisaInfo").val()),
							  Alert: escape($("#Alert").val()),
							  Assert: escape($("#Assert").val())
						  };
					  };
					  //修改数据定义
					  ProcessData.ModifyData = function () {
						  return {
							  DID: ProcessData.CurrentSelectRow.DID,
							  AID: $("#AID").combobox('getValue'),
							  Number: $("#Number").val(),
							  Type: $("#Type").val(),
							  Price: $("#Price").val(),
							  Workday: $("#Workday").val(),
							  MaxStay: $("#MaxStay").val(),
							  StayUnit: $("#StayUnit").combobox('getValue'),
							  ValidityDate: $("#ValidityDate").val(),
							  ValidityUnit: $("#ValidityUnit").combobox('getValue'),
							  VisitorArea: $("#VisitorArea").val(),
							  VisaInfo: escape($("#VisaInfo").val()),
							  Alert: escape($("#Alert").val()),
							  Assert: escape($("#Assert").val())
						  };
					  }
					  //编辑数据定义
					  ProcessData.EditorData = function () 
					  {
						  $("#AID").combobox('setValue', ProcessData.CurrentSelectRow.AID);
						  $("#Number").val(ProcessData.CurrentSelectRow.Number);
						  $("#Type").val(ProcessData.CurrentSelectRow.Type);
						  $("#Price").val(ProcessData.CurrentSelectRow.Price);
						  $("#Workday").val(ProcessData.CurrentSelectRow.Workday);
						  $("#MaxStay").val(ProcessData.CurrentSelectRow.MaxStay);
						  $("#StayUnit").combobox('setValue', ProcessData.CurrentSelectRow.StayUnit);
						  $("#ValidityDate").val(ProcessData.CurrentSelectRow.ValidityDate);
						  $("#ValidityUnit").combobox('setValue', ProcessData.CurrentSelectRow.ValidityUnit);
						  $("#VisitorArea").val(ProcessData.CurrentSelectRow.VisitorArea);
			
						  //alert(CurrentSelectRow.VisaInfo);
						  $("#VisaInfo").val(unescape(ProcessData.CurrentSelectRow.VisaInfo));
						  $("#Alert").val(unescape(ProcessData.CurrentSelectRow.Alert));
						  $("#Assert").val(unescape(ProcessData.CurrentSelectRow.Assert));
					  }
					  //冻结列
					  ProcessData.frozenColumns =
					  [[
						  { field: 'ck', checkbox: true },
						  { field: 'edit', title: '编辑',
							  formatter: function (value, rec) {
								  //alert(escape(jsonToString(rec)));  
								  return "<span style='color:#ed8325; cursor:pointer;' onclick='ProcessData.editor(\"" + escape(jsonToString(rec)) + "\");'>编辑</span>";
							  }
						  }
					  ]];
					  //表格加载列设置
					  ProcessData.TableColumns =
					  [[
						  { field: 'Country', title: '签证国家', width: 120, sortable: true },
						  { field: 'Number', title: '签证编号', width: 60, sortable: true },
						  { field: 'Type', title: '签证类型', width: 120, sortable: true },
						  { field: 'Price', title: '签证价格', width: 60, sortable: true,
							  formatter: function (value, rec) {
								  return value + "元";
							  }
						  },
						  { field: 'Workday', title: '办理工作日', width: 60, sortable: true,
							  formatter: function (value, rec) {
								  return value + "个";
							  }
						  },
						  { field: 'MaxStay', title: '签证可停留', width: 60, sortable: true,
							  formatter: function (value, rec) {
								  var unit;
								  switch (parseInt(rec.StayUnit)) {
									  case 0:
										  unit = "天";
										  break;
									  case 1:
										  unit = "周";
										  break;
									  case 2:
										  unit = "月";
										  break;
									  case 3:
										  unit = "年";
										  break;
								  }
			
								  return value + unit;
							  } //end formatter
						  },
						  { field: 'ValidityDate', title: '有效期从', width: 60, sortable: true,
							  formatter: function (value, rec) {
								  if (0 == value)
									  return "领馆定";
								  var unit;
								  switch (parseInt(rec.StayUnit)) {
									  case 0:
										  unit = "天";
										  break;
									  case 1:
										  unit = "周";
										  break;
									  case 2:
										  unit = "月";
										  break;
									  case 3:
										  unit = "年";
										  break;
								  }
			
								  return value + unit;
							  } //end formatter
						  }
					  ]];
			
					  //初始化
					  ProcessData.init(
					  { 
						  Url: "./VisaDetailProcess.ashx",
						  ID : "DID",                 //ID字段
						  Describe: "Type"            //描述字段 
					  });
			
				  });
				  //]]></script>
				<style type="text/css">

					body{ margin:0; padding:0; border:0; font-size:12px;}
					.easyui-datebox { width:80px;}
					.queryControl { list-style-type:none; height:25px; margin:0; padding:5px 0; background:#cccccc;}
					.queryControl li { float:left; margin-left:5px;}
			
			
					.combo-panel { width:120px;}
			
			
				</style>
			</head>
			<body>
				<ul class="queryControl">
					<li>
						<label>关键字：</label>
						<span>
							<input id="Keyword" class="easyui-validatebox"/>
						</span>
					</li>
					<li>
						<a href="javascript:loadNewsGird();" class="easyui-linkbutton" icon="icon-search">搜索</a>
					</li>
				</ul>
				<div>
					<table id="DataTableView"/>
				</div>
				<div id="EditWindow" class="easyui-window" style="width:460px;height:500px; " title="签证地区编辑" icon="icon-add" closed="true" minimizable="false" maximizable="false" modal="true">
					<table>
						<tr style=" margin:5px;">
							<td for="AID">签证国家:</td>
							<td>
								<select id="AID" name="AID" class="easyui-combobox" style="width:120px;" required="true"/>
								<span style="color:red;">*</span>
							</td>
						</tr>
						<tr style=" margin:5px;">
							<td for="Number">签证自编号:</td>
							<td>
								<input id="Number" class="easyui-validatebox" required="true" style="width:120px;" validType="length[1,50]"/>
								<span style="color:red;">*</span>
							</td>
						</tr>
						<tr style=" margin:5px;">
							<td for="Type">签证类型名:</td>
							<td>
								<input id="Type" class="easyui-validatebox" required="true" style="width:160px;" validType="length[1,50]"/>
								<span style="color:red;">*</span>
							</td>
						</tr>
						<tr style=" margin:5px;">
							<td for="Price">签证价格:</td>
							<td>
								<input id="Price" class="easyui-numberspinner" min="1" max="100000000" value="1" style="width:80px;" required="true"/>元
            <span style="color:red;">*</span>
							</td>
						</tr>
						<tr style=" margin:5px;">
							<td for="Workday">办理工作日:</td>
							<td>
								<input id="Workday" name="Workday" class="easyui-numberspinner" min="1" max="10000" value="1" style="width:80px;" required="true"/>个
            <span style="color:red;">*</span>
							</td>
						</tr>
						<tr style=" margin:5px;">
							<td for="MaxStay">签证可停留:</td>
							<td>
								<input id="MaxStay" name="MaxStay" class="easyui-numberspinner" min="1" max="10000" value="1" style="width:80px;" required="true"/>
								<select id="StayUnit" name="StayUnit" class="easyui-combobox" style="width:50px;" required="true">
									<option value="0">天</option>
									<option value="1">周</option>
									<option value="2">月</option>
									<option value="3">年</option>
								</select>
								<span style="color:red;">*</span>
							</td>
						</tr>
						<tr style=" margin:5px;">
							<td for="ValidityDate">有效期从:</td>
							<td>
								<input id="ValidityDate" name="ValidityDate" class="easyui-numberspinner" min="0" max="10000" style="width:80px;" value="0" required="true"/>
								<select id="ValidityUnit" name="ValidityUnit" class="easyui-combobox" style="width:50px;" required="true">
									<option value="0">天</option>
									<option value="1">周</option>
									<option value="2">月</option>
									<option value="3">年</option>
								</select>
								<span style="color:red;">* 0为【领馆定】</span>
							</td>
						</tr>
						<tr style=" margin:5px;">
							<td for="VisitorArea">收客范围:</td>
							<td>
								<input id="VisitorArea" class="easyui-validatebox" value="不限" required="true" style="width:80px;" validType="length[1,50]"/>
								<span style="color:red;">*</span>
							</td>
						</tr>
						<tr style=" margin:5px;">
							<td for="VisaInfo">签证所需材料:</td>
							<td>
								<textarea id="VisaInfo" name="VisaInfo" style="height:60px; width:320px;"/>
							</td>
						</tr>
						<tr style=" margin:5px;">
							<td for="Alert">特别提示:</td>
							<td>
								<textarea id="Alert" name="Alert" style="height:60px; width:320px;"/>
							</td>
						</tr>
						<tr style=" margin:5px;">
							<td for="Assert">特别声明:</td>
							<td>
								<textarea id="Assert" name="Assert" style="height:60px; width:320px;"/>
							</td>
						</tr>
						<tr style=" background:#cccccc; text-align:center; ">
							<td colspan="2">
								<a href="javascript:void(0);" id="ProcessDataSaveBtn" class="easyui-linkbutton" icon="icon-save">保存</a>
							</td>
						</tr>
					</table>
				</div>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>
